From 83624e6b662e2d07602b7184e8c1a8dc5c020b26 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Tue, 4 Nov 2003 13:13:08 +0000 Subject: [PATCH] bitkeeper revision 1.555 (3fa7a5e43euoBbbuurbkHsps0sbRqQ) init.c, setup.c, network.c, xl_block.c: Small cleanups for previous checkin. --- .../arch/xeno/drivers/block/xl_block.c | 33 ++++++++++++------- .../arch/xeno/drivers/network/network.c | 4 ++- .../arch/xeno/kernel/setup.c | 2 ++ xenolinux-2.4.22-sparse/arch/xeno/mm/init.c | 2 ++ 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c b/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c index c3cf866de5..56dab7e3f3 100644 --- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c +++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c @@ -490,6 +490,23 @@ void do_xlblk_request(request_queue_t *rq) } +static void kick_pending_request_queues(void) +{ + /* We kick pending request queues if the ring is reasonably empty. */ + if ( (nr_pending != 0) && + (((req_prod - resp_cons) & (BLK_RING_SIZE - 1)) < + (BLK_RING_SIZE >> 1)) ) + { + /* Attempt to drain the queue, but bail if the ring becomes full. */ + while ( nr_pending != 0 ) + { + do_xlblk_request(pending_queues[--nr_pending]); + if ( RING_PLUGGED ) break; + } + } +} + + static void xlblk_response_int(int irq, void *dev_id, struct pt_regs *ptregs) { int i; @@ -538,18 +555,7 @@ static void xlblk_response_int(int irq, void *dev_id, struct pt_regs *ptregs) resp_cons = i; - /* We kick pending request queues if the ring is reasonably empty. */ - if ( (nr_pending != 0) && - (((req_prod - resp_cons) & (BLK_RING_SIZE - 1)) < - (BLK_RING_SIZE >> 1)) ) - { - /* Attempt to drain the queue, but bail if the ring becomes full. */ - while ( nr_pending != 0 ) - { - do_xlblk_request(pending_queues[--nr_pending]); - if ( RING_PLUGGED ) break; - } - } + kick_pending_request_queues(); spin_unlock_irqrestore(&io_request_lock, flags); } @@ -692,4 +698,7 @@ void blkdev_suspend(void) void blkdev_resume(void) { reset_xlblk_interface(); + spin_lock_irq(&io_request_lock); + kick_pending_request_queues(); + spin_unlock_irq(&io_request_lock); } diff --git a/xenolinux-2.4.22-sparse/arch/xeno/drivers/network/network.c b/xenolinux-2.4.22-sparse/arch/xeno/drivers/network/network.c index 00af8be834..748571a98f 100644 --- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/network/network.c +++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/network/network.c @@ -321,7 +321,9 @@ static inline void _network_interrupt(struct net_device *dev) if ( rx->status != RING_STATUS_OK ) { - printk(KERN_ALERT "bad buffer on RX ring!(%d)\n", rx->status); + /* Gate this error. We get a (valid) slew of them on suspend. */ + if ( np->state == STATE_ACTIVE ) + printk(KERN_ALERT "bad buffer on RX ring!(%d)\n", rx->status); dev_kfree_skb_any(skb); continue; } diff --git a/xenolinux-2.4.22-sparse/arch/xeno/kernel/setup.c b/xenolinux-2.4.22-sparse/arch/xeno/kernel/setup.c index 6fdbf9d165..9c70c61a71 100644 --- a/xenolinux-2.4.22-sparse/arch/xeno/kernel/setup.c +++ b/xenolinux-2.4.22-sparse/arch/xeno/kernel/setup.c @@ -1080,12 +1080,14 @@ static void stop_task(void *unused) __cli(); + HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page; clear_fixmap(FIX_SHARED_INFO); HYPERVISOR_stop(); set_fixmap(FIX_SHARED_INFO, start_info.shared_info); HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO); + memset(empty_zero_page, 0, PAGE_SIZE); __sti(); diff --git a/xenolinux-2.4.22-sparse/arch/xeno/mm/init.c b/xenolinux-2.4.22-sparse/arch/xeno/mm/init.c index ef77f9629b..883cd03b37 100644 --- a/xenolinux-2.4.22-sparse/arch/xeno/mm/init.c +++ b/xenolinux-2.4.22-sparse/arch/xeno/mm/init.c @@ -113,8 +113,10 @@ static inline void set_pte_phys (unsigned long vaddr, } pte = pte_offset(pmd, vaddr); +#if 0 /* Not in Xen, since this breaks clear_fixmap. */ if (pte_val(*pte)) pte_ERROR(*pte); +#endif /* We queue directly, avoiding hidden phys->machine translation. */ queue_l1_entry_update(pte, phys | pgprot_val(prot)); -- 2.30.2